<?php $this->load->view('home/layout/header') ?>
	<div class="widthMax">
		<div class="ios-head">
            <?php if ($this->isAppHeader == 2) : ?>
			<a  href=" <?php echo isset($_SERVER['HTTP_REFERER']) ? 'javascript:history.go(-1);' : site_url('home/ucenter/index'); ?>" class="drax-return">
	            <i class="iconfont icon-zuojiantou"></i>
	        </a>
            <?php endif; ?>

	        <a href="<?php echo site_url('home/ucenter/index'); ?>" class="drax-beizhu">
	            <i class="iconfont">&#xe616;</i>
	        </a>
			<?php $page1 = empty($lottery->page1) ? '' : json_decode($lottery->page1); ?>
            
	        <div class="ios-text">
	        	<p class="ios-text1"><?php echo empty($page1->title1) ? '参与幸运大转盘' : $page1->title1; ?></p>
	        	<p class="ios-text2"><?php echo empty($page1->title2) ? '天天抽奖不打烊' : $page1->title2; ?></p>
	        	<p class="ios-text3"><?php echo empty($page1->title3) ? '赶紧去试试手气吧' : $page1->title3; ?></p>
	        </div>

	        <div class="ios-info am-cf">
        	   <span>已抽奖<em><?php echo empty($lottery->user_total) ? 0 : $lottery->user_total; ?></em>人</span>
        	   <span>已中奖<em><?php echo empty($lottery->winners_total) ? 0 : $lottery->winners_total; ?></em>人</span>
	        </div>
            <?php $page2 = empty($lottery->page2) ? '' : json_decode($lottery->page2);?>
	        <?php if ( !empty($page2->content)) : ?>
            <a class="ios-detail" href="<?php echo site_url('home/lottery/introduce'), '?id=', $lottery->lottery_id;; ?>">活动详情</a>
            <?php endif; ?>

			<div class="ios-trope ">
				<div class="trope-title">
					<p>今日奖品</p>
				</div>
			</div>
		</div>
		<div class="ios-content-wrap item<?php echo count($activityPrize); ?> <?php echo (count($activityPrize) > 4) ? 'item-more' : ''; ?>">
			<div class="ios-content">
				<ul class="am-cf">
				<?php foreach($activityPrize as $value) : ?>
					<li>
						<a href="<?php echo empty($value->links) ? 'javascript:;' : $value->links;?>">
							<div class="ios-item-img">
								<img src="<?php echo $this->config->show_image_url($value->image, '300-300'); ?>">
							</div>
							<p class="ios-item-info"><?php echo $value->prize_name; ?></p>
						</a>
					</li>
				<?php endforeach; ?>
				</ul>
			</div>
		</div>
		<div class="ios-foot">
			<div class="ios-button">
				<a href="<?php echo site_url('home/lottery/participate'), '?id=', $lottery->lottery_id; ?>" class="ios-luck">
					我要去抽奖
				</a>
				<div class="weix-luck flex">
					<a href="<?php echo site_url('home/apply/applyLottery'), '?id=', $lottery->lottery_id;; ?>">
						我要创建抽奖
					</a>
					<a href="<?php echo site_url();?>">进入</a>
				</div>
			</div>
		</div>
	</div>

	<?php if ( !empty($style->draw_detail)) : ?>
    <?php $drawDetail = explode('<br/>', nl2br($style->draw_detail)); ?>
    <div class="am-modal am-modal-detail" tabindex="-1" id="am-modal-detail">
      <div class="am-modal-dialog">
        <div class="am-modal-hd">
            <h2><span>活动<br/>详情</span></h2>
        </div>
        <a href="javascript: void(0)" class="am-close" data-am-modal-close>&times;</a>
        
        <div class="am-modal-bd">
            <?php foreach($drawDetail as $value): ?>
            <p><?php echo $value; ?></p>
            <?php endforeach; ?>
        </div>
      </div>
    </div>
    <?php endif; ?>

<?php $this->load->view('home/layout/footer') ?>
<?php js('home', 'pages/lottery')?>

